# DimChooser Class
setClass("DimChooser",representation(
					.description="character",
					.dimSeqStart="integer",
					.dimSeqLength="integer",
					"VIRTUAL"
				),
				prototype=prototype(
						.description="Virtual DimChooserClass Class"
						),
				validity=function(.Object){
					if(.Object@.dimSeqStart<=0 || .Object@.dimSeqLength <=0){
						stop("DimChooser validation .dimSeqStart and .dimSeqLength should be positive integer ")
					}else{}
				}
						)
#generic functions
setGeneric("get_description",function(.Object){standardGeneric("get_description")})
#this function must be called during reduce function evaluation
setGeneric("chooseBest",function(.Object,reducer,...){standardGeneric("chooseBest")})
#methods

setMethod("initialize",
		signature="DimChooser",
		definition=function(.Object,dimSeqStart,dimSeqLength){
			.Object@.dimSeqStart	<- as.integer(dimSeqStart);
			.Object@.dimSeqLength	<- as.integer(dimSeqLength); 
			validObject(.Object)
			return(.Object)
		})

setMethod("get_description",
		signature="DimChooser",
		definition=function(.Object){
			.Object@.description
		})

